package com.example.springbootmybatis.service.impl;

import com.example.springbootmybatis.entity.DeptTab;
import com.example.springbootmybatis.mapper.DeptMapper;
import com.example.springbootmybatis.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cuikaixuan
 * @date 2021/4/22  9:19
 * @desc 部门(组织)业务处理
 */
@Service
public class DeptService implements IDeptService {

    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<DeptTab> getAllDept(String deptName) {
        return deptMapper.getAllDept(deptName);
    }

    @Override
    public int insertDept(DeptTab deptTab) {
        return deptMapper.insertDept(deptTab);
    }

    @Override
    public int batchRemove(Boolean remove, List<Integer> ids) {
        int count = deptMapper.batchRemove(remove, ids);
        return count;
    }

    @Override
    public int batchInsertDept(List<DeptTab> deptTabs) {
        int count = deptMapper.batchInsertDept(deptTabs);
        return count;
    }
}
